package sugarbind_input

class Ligand_Type {

    String ligand_Type_Name
	
    static constraints = {
			ligand_Type_Name(blank:false)
			
			ligand_Type_Name(unique:true)
	}
	
	static hasMany = [ligands: Ligand]
	static belongsTo = Ligand
	
	static mapping = {
//		id column: 'ligand_type_id'
		id generator: 'sequence', params: [sequence: 'ligand_type_id_seq']
		
		ligands joinTable: [name: "ligand_ligand_type", key: 'ligand_type_id' ]
	}
	
	public String toString(){
		ligand_Type_Name //+ " " + id
	}
}
